package com.exercise.AndroidCamera;

import android.app.ActionBar;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Display;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.WindowManager;
/*
기능 : 친구리스를 보여주는 기능 (서버와 연동)
작성 : 하드캔
완료일 : 2014.09.26 
	*/
public class FriendListActivity extends Activity {

	Intent mIntent;
	String userID;

	private int mDeviceScreenWidth;
	private int mDeviceScreenHeight;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_friend_list);
		
		userID = getIntent().getExtras().getString("userID");
		
        
        Display display = ((WindowManager)getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
        mDeviceScreenWidth = display.getWidth();
        mDeviceScreenHeight = display.getHeight();
        
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
	}
	
	public boolean onTouchEvent(MotionEvent event) {
		if (event.getAction() == MotionEvent.ACTION_DOWN) {
		int x = (int)event.getX();
		int y = (int)event.getY();
		Bitmap bitmapScreen = Bitmap.createBitmap(mDeviceScreenWidth, mDeviceScreenHeight, Bitmap.Config.ARGB_8888);
		
		if(x < 0 || y < 0)
			return false;

		int ARGB = bitmapScreen.getPixel(x, y);

		if(Color.alpha(ARGB) == 0) 
		{
			finish();
		}
		return true;
	}
	return false;
	}
}
